package com.cyq.day04;

import java.util.Scanner;

public class ClassWork02 {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        //求出100以内的偶数和奇数和
//        int i;
//        int sum1=0;
//        int sum2=0;
//        for (i=0;i<=100;i+=2){
//            sum1+=i;
//        }
//        for (i=1;i<=100;i+=2){
//            sum2+=i;
//        }
//        System.out.println("偶数和为"+sum1+"奇数和为"+sum2);
        int sum1 = 0;
        int sum2 = 0;
        for (int i=0;i<=100;i++){
            if (i%2==0){
                sum1+=i;
            }else{
                sum2+=i;
            }
        }
        System.out.println("偶数和为"+sum1+"奇数和为"+sum2);
    }
}
